﻿// MIT License
// 开源地址：https://gitee.com/co1024/AbcMvc
// Copyright (c) 2021-2023 1024
// Abc.Mvc=Furion+EF+SqlSugar+Pear layui admin.

namespace Abc.Application.HtAdminServices;

public interface IHtMenuService
{
    /// <summary>
    /// 新增或更新一条
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    Task InsertOrUpdate(HtMenuInput input);

    /// <summary>
    /// 删除一条
    /// </summary>
    /// <param name="id"></param>
    Task Delete(long id);

    /// <summary>
    /// 批量假删除
    /// </summary>
    /// <param name="ids">需要删除的数据，多条以英文逗号隔开</param>
    Task BatchFakeDelete(string ids);

    /// <summary>
    /// 查询一条
    /// </summary>
    /// <param name="id"></param>
    Task<HtMenuOut> Get(long id);

    /// <summary>
    /// 查询一条[跟踪实体]
    /// </summary>
    /// <param name="code"></param>
    Task<HtMenuOut> GetByCode(string code);

    /// <summary>
    /// 分页查询
    /// </summary>
    /// <param name="searchQuery"></param>
    /// <returns></returns>
    Task<LayuiPagedList<HtMenuOut>> GetAllByPageToLayui(HtMenuQuery searchQuery);

    /// <summary>
    /// 设置状态
    /// </summary>
    /// <param name="id"></param>
    /// <param name="state"></param>
    /// <param name="field">字段名</param>
    /// <returns></returns>
    Task SetState(long id, bool state, string field);

    /// <summary>
    /// 获取MenuPermission Area 集合
    /// </summary>
    /// <returns></returns>
    Task<List<string>> GetMenuAreas();

    /// <summary>
    /// 查询菜单下拉树
    /// </summary>
    /// <returns></returns>
    Task<Dtree> GetDtree(string pid = "");

    /// <summary>
    /// 获取后台左侧菜单列表
    /// </summary>
    /// <param name="area">区域</param>
    /// <returns></returns>
    Task<List<PearMenuItemOut>> GetMenus(string area);
}